package model.dao;

import java.io.IOException;
import java.io.Reader;
import java.sql.SQLException;
import java.util.List;

import model.dto.accDTO;

import com.ibatis.common.resources.Resources;
import com.ibatis.sqlmap.client.SqlMapClient;
import com.ibatis.sqlmap.client.SqlMapClientBuilder;

public class accDAO {
	private static SqlMapClient client = DAOparser.getParser();
	
	public static void insertAccClick(accDTO dto) throws SQLException{
		client.insert("accClick.insertAccClick", dto);
		System.out.println("DAOinsert함수 실행완료");
	}
	
	//.queryForList("accClick.selectTagId")
	public static List selectTagId(String str) throws SQLException{
		System.out.println("DAO selectTagId함수");
		return client.queryForList("accClick.selectTagId",str);
	}
	
	public static void updateAccClick(accDTO dto) throws SQLException{
		System.out.println("DAO update함수");
		client.update("accClick.updateAccClick",dto);
	}
	
	//queryForList("accClick.selectRank")
	public static List selectRank(String str) throws SQLException{
		System.out.println("DAO selectRank함수");
		return client.queryForList("accClick.selectRank",str);
	}
	
	public static void createTable(String userId) throws SQLException{
		client.update("accClick.createTable",userId);
	}
}
